//
// Created by Administrator on 2024/3/25.
//
#include<bits/stdc++.h>

using namespace std;
using ll = long long;

int main() {
    ll m;
    cin >> m;
    vector<ll> dp(m + 1, 0);
    for (ll i = 1; i <= m; i++)dp[i] = i * (i + 1) / 2;
//	copy(dp.begin(),dp.end(),ostream_iterator<ll>(cerr," "));
//(i+j)*(j-i+1)==2*m
    for (int i = 0; i <= m; i++) {
        ll key = m + dp[i];
        auto j = lower_bound(dp.begin() + i + 2, dp.end(), key) - dp.begin();
        if (dp[j] == key) {
            cout << i + 1 << " " << j << endl;
        }
    }
    return 0;
}